home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / eText5 / Source / 8Bawl.bproj / EBI.m < prev    next >
Encoding:
Text File  |  1994-11-01  |  2.1 KB  |  97 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //    FILENAME:    EBI.m
  3. //    SUMMARY:    an Eight-Ball (TM) Infopanel
  4. //    SUPERCLASS:    Object
  5. //    INTERFACE:    None
  6. //    PROTOCOLS:    <Inspectable>
  7. //    AUTHOR:        Rohit Khare
  8. //    COPYRIGHT:    (c) 1994 California Institure of Technology, eText Project
  9. ///////////////////////////////////////////////////////////////////////////////
  10. //    DESCRIPTION
  11. //        Stupid infopanel container
  12. ///////////////////////////////////////////////////////////////////////////////
  13. //    HISTORY
  14. //    10/31/94:    Converted to eText5; modified inspector protocol
  15. //    05/22/94:    Created. First eText port.
  16. ///////////////////////////////////////////////////////////////////////////////
  17. #import "../eTextKernel.h"
  18. @interface EightBawl:Object <Annotation, Tool>
  19. {    BOOL    highlighted;
  20.     int        animStep;
  21.     id        cimage;
  22.     NXRect  savedFrame;
  23.     NXPoint savedPoint;
  24. }
  25. @end
  26. @interface EBI:Object <Inspectable>
  27. {
  28.     id infoPanel;
  29.     id infoView;
  30. }
  31. +new;
  32. @end
  33.  
  34. @implementation EBI
  35. // Insurance policy for bundle principal-class ordering
  36. + toolAwake:theApp {return [EightBawl toolAwake:theApp];}
  37.  
  38. #define    INFO    "Info"
  39.  
  40. + new
  41. {
  42.     static EBI *ebi = nil;
  43.     
  44.     if (!ebi) {
  45.         ebi = [[EBI alloc] init];
  46.     }
  47.     return ebi;
  48. }
  49. - free {return self;}
  50. - init
  51. {
  52.     char        buf[MAXPATHLEN];
  53.     NXBundle   *bundle;
  54.     
  55.     [super init];
  56.     bundle = [NXBundle bundleForClass:[EBI class]];
  57.     if ( [bundle getPath:buf forResource:"8Bawl" ofType:"nib"] ) {
  58.         [NXApp loadNibFile:buf owner:self withNames:NO];
  59.     } else {
  60.         NXLogError("NIB not found: 8Bawl");
  61.     }
  62.     infoView = [infoPanel contentView];
  63.     return self;
  64. }
  65. - (const NXAtom *) types
  66. {
  67.     static NXAtom types[2] = {NULL, NULL};
  68.     
  69.     if (!types[0]) {
  70.         types[0] = NXUniqueString(INFO);
  71.     }
  72.     return types;
  73. }
  74.  
  75. - (const char *) inspectorTitle
  76. {
  77.     return NXUniqueString("8Bawl");
  78. }
  79.  
  80. - resignInspector: (View *) oldInspector ofType: (const char *) type 
  81. {
  82.     return self;
  83. }
  84.  
  85. - activateInspector: (View *) newInspector ofType: (const char *) type 
  86. {
  87.     return self;
  88. }
  89.  
  90. - inspectorForType:(const char *) type 
  91. {
  92.     if(!strcmp(type,INFO))
  93.         return infoView;
  94.     else NXLogError("Massive Inspector Failure: Asked EBI for: %s", type);
  95.     return infoView;
  96. }
  97. @end